//
//  BaseSort.swift
//  Sorts
//
//  Created by lhc on 2023/12/10.
//

import Foundation

enum OperatorType {
    case exchange
    case assign
}

class BaseSort {
    var array: [Int]
    
    init(list: [Int]) {
        self.array = list
    }
    
    func exchange(a: Int, b: Int) {
        let temp = self.array[a]
        self.array[a] = self.array[b]
        self.array[b] = temp
    }
    
    func sort(action: ((OperatorType, (Int, Int)) -> ())) {
        
    }
    
    static func generateList(length: Int, floor: Int, celling: Int) -> [Int] {
        var array = [Int]()
        guard celling > floor else {return array}
        
        for _ in 0..<length {
            array.append(Int.random(in: floor...celling))
        }
        
        return array
    }
    
    
}
